<script setup>
import useLogin from "@/hooks/login";

const { userInfo, login } = useLogin();
</script>

<template>
  <div class="login-pages">
    <div class="login-pages__context">
      <p class="login-title">登录</p>
      <el-form :model="userInfo" label-width="120px">
        <el-form-item label="用户名称">
          <el-input
            v-model="userInfo.userName"
            placeholder="用户名称"
            clearable
          ></el-input>
        </el-form-item>
        <el-form-item label="密码">
          <el-input
            type="password"
            v-model="userInfo.password"
            placeholder="用户密码"
            clearable
            show-password
          ></el-input>
        </el-form-item>
        <el-form-item>
          <el-button @click="login">登录</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<style lang="scss">
.login-pages {
  background-image: url("../assets/images/bg-login.jpeg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  width: 100%;
  height: 100%;
  &__context {
    position: relative;
    top: calc(50% - 200px);
    left: calc(50% - 168px);
    background-color: #f3f3f3;
    width: 336px;
    height: 400px;
    text-align: center;
    border-radius: 15px;
    .login-title {
      margin: 20px;
    }
  }
}
</style>
